class_name EquipmentIceSword
extends EquipmentBase


@onready var animation_player: AnimationPlayer = $AnimationPlayer


func _ready() -> void:
	animation_player.play("idle")


func add_frozen_debuff(source: Node2D):
	var frozen_hit_rate = item_data.item_config.frozen_hit_rate
	var is_hit = randf() < frozen_hit_rate
	if is_hit and not source.get_buff_by_name("debuff_frozen"):
		var buff_inst = source.add_buff("debuff_frozen", holder)
		
		buff_inst.frozen_speed_scale = item_data.item_config.frozen_speed_scale
		buff_inst.duration = item_data.item_config.frozen_duration
		buff_inst.start_buff()
